﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Rotempco.Website.Logic;
using Rotempco.Core.Web.CRUD.Objects;
using Rotempco.Core.Web.Logic;

namespace Rotempco.Website.MasterPages.UserControls
{
    public partial class RestorePageList : System.Web.UI.UserControl
    {
        private bool _ShowRestoreButton = true; // Indtil videre

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void SetDetailsList(PageListContainer detailPageContainer)
        {
            repeater_Headers.DataSource = detailPageContainer.Headers;
            repeater_Headers.DataBind();

            repeater_Rows.DataSource = detailPageContainer.DetailRows;
            repeater_Rows.DataBind();
        }

        protected bool ShowRestoreButton()
        {
            return _ShowRestoreButton;
        }

        protected string GetRestoreUrl(object idString)
        {
            long id = long.Parse(idString.ToString());
            return UrlLogic.GotoUrl(url: UrlLogic.GetStaticBaseUrl() + "/Restore.aspx", id: id);
        }

    }
}